/**
 * email=123@qq.com
 * password=789
 * 插入到  users 集合中
 */
const db = require('./db/db');
//导入 UserModel
const UserModel = require('./models/UserModel');
const MovieModel = require('./models/MovieModel');
//导入 mongoose
const mongoose = require('mongoose');

db(() => {
  //模型对象
  MovieModel.create({
    name: '灌篮高手',
    director: 'xx',
    actors: ['流川枫','樱木花道'],
    rate: 9,
    pub_time: new Date(2023, 3, 25)
  }, (err, data) => {
    if(err) throw err;
    console.log(data);
  })

  
}, () => {
  console.log('连接失败~~');
});

